Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HiddenFilePathFilter: Fix hidden sequences #5831

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

ericmehl
Copy link
Collaborator

Fixes #5810

When checking a path that has the # character for frame substitutions, HiddenFilePathFilter would always treat it as hidden. The file with # does not exist, so the Windows API would return INVALID_FILE_ATTRIBUTES whose value is -1. FILE_ATTRIBUTE_HIDDEN has a value of 2. -1 & 2 = 2, so sequences would always be considered hidden.

Checklist

  • I have read the contribution guidelines.
  • I have updated the documentation, if applicable.
  • I have tested my change(s) in the test suite, and added new test cases where necessary.
  • My code follows the Gaffer project's prevailing coding style and conventions.

@ericmehl ericmehl changed the base branch from main to 1.3_maintenance April 29, 2024 22:04
Copy link
Member

@johnhaddon johnhaddon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM apart from the Changes.md quibble, but the new test is failing on Linux, so I must have missed something.

Changes.md Outdated
Fixes
-----

- File Browser : Windows only : Fixed bug in `HiddenFilePathFilter` that caused sequences to be treated as though they are hidden files.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should reference the relevant issue here with #.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, thanks for the reminder. Added and squashed into 6108cc8

Fixes GafferHQ#5810

When checking a path that has the `#` character for frame substitutions,
`HiddenFilePathFilter` would always treat it as hidden. The file with
`#` does not exist, so the Windows API would return
`INVALID_FILE_ATTRIBUTES` whose value is `-1`. `FILE_ATTRIBUTE_HIDDEN`
has a value of `2`. `-1 & 2 = 2`, so sequences would always be
considered hidden.
@ericmehl
Copy link
Collaborator Author

I was getting away with not sorting the file lists in the unit test on Windows, but Linux was not as forgiving. Should be sorted literally and figuratively in 6108cc8.

Copy link
Member

@johnhaddon johnhaddon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates Eric - LGTM.

@johnhaddon johnhaddon merged commit 0660525 into GafferHQ:1.3_maintenance Apr 30, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

File dialog: Show sequences shows no files unless Show hidden files is checked
2 participants